const fs = require('fs');
const path = require('path');

var filePath = path.join(__dirname, './a.txt')
var fd = fs.openSync(filePath, 'r'); //r表示做读的操作

var buf = Buffer.alloc(10);

var result = fs.readSync(fd, buf);